With the 'eaten' attribute you can set a script file that is called when you have eaten a food. You can use world, player and living for your script, where living is the player/monster you are hit.
eaten="loader.loadScript('xyz.script');";